from enum import Enum

AGENT_FINAL_ANSWER_STR = "Final Answer"
# 监督者路由结果的键名
SUPERVISOR_ROUTE_RESULT = "_supervisor_route_result_"

class LLMType(str, Enum):
    LLM_CHAT = "LLM_CHAT"
    LLM_VL = "LLM_VL"
    LLM_IMAGE = "LLM_IMAGE"
    LLM_EMB = "LLM_EMB"


class AgentActions(Enum):
    SEARCH_WEB = "search_web"
    AGENT_ROUTE = "agent_route"


def get_action_final_answer(action_text: str) -> str:
    if AGENT_FINAL_ANSWER_STR in action_text:
        parts = action_text.split(AGENT_FINAL_ANSWER_STR)
        if len(parts) > 1:
            return parts[-1].strip().lstrip(':').strip()
    return None
